//
//  EmotionView.m
//  JiaoX
//
//  Created by yinqy on 15/3/31.
//  Copyright (c) 2015年 北京娇羞科技有限公司. All rights reserved.
//

#import "EmotionView.h"

@implementation EmotionView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.adjustsImageWhenHighlighted = NO;
    }
    return self;
}

-(void)setEmotion:(EmotionInfo *)emotion{
    _emotion = emotion;
    NSString *icon = [NSString stringWithFormat:@"%@", emotion.png];
    UIImage *image = [UIImage imageNamed:icon];
    if (iOS7) { // 不需要进行蓝色的渲染
        image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    }
    [self.imageView setContentMode:UIViewContentModeScaleAspectFit];
    [self setImage:image forState:UIControlStateNormal];
    [self setTitle:nil forState:UIControlStateNormal];

}
@end
